#ifndef __TCP_H_
#define __TCP_H_

class TcpServer
{
public:
    TcpServer(const char *ip, const unsigned short port);

    //类内声明
    int TcpServerAccept();
    bool TcpServerSend(int clientfd, void *ptr, int size);
    bool TcpServerRecv(int clientfd, void *ptr, int size);

    // ~TcpServer()
    // {
    //     close(serverfd);
    // }

private:
    int serverfd;
};

class TcpClient
{
public:
    TcpClient(const char *Serverip, const unsigned short Serverport);

    //类内声明
    bool TcpClientSend(void *ptr, int size);
    bool TcpClientRecv(void *ptr, int size);

    // ~TcpClient()
    // {
    //     close(clientfd);
    // }
private:
    int clientfd;
};


#endif